﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Domain;
using Microsoft.Practices.Unity;

namespace WebUI.Controllers
{
    public class ContactController : Controller
    {
        [Dependency]
        public IRepository repository { get; set; }

        //public ContactController()
        //{
        //    this.repository = new XmlDomain.Repository();
        //}

        public ContactController(IRepository repository)
        {
            this.repository = repository;
            
        }

        [HttpPost]
        public ActionResult Index(IContact contact)
        {
            return View(contact);
        }




        public ActionResult Index()
        {

            var contact = repository.Contacts.Where(e => e.Id == 45).FirstOrDefault();

            return View(contact);
        }


      

    }
}
